import request from '@/config/axios'
import type { OrganizationData } from './types'

export const getOrganizationListApi = (params: any): Promise<IResponse> => {
    const queryParams = params.queryParams ? params.queryParams : {}
    if (params.queryParams) {
        delete params.queryParams
    }
    Object.assign(params, queryParams)
    return request.get({url: '/balance/group/org/page', params})
}

export const saveOrganizationApi = (data: Partial<OrganizationData>): Promise<IResponse> => {
    return request.post({url: '/balance/group/org/save', data})
}

export const delOrganizationListApi = (data: Partial<OrganizationData>[]): Promise<IResponse> => {
    return request.post({url: '/balance/group/org/delete', data})
}
